#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_speed_20_clicked()
{
    _speed = 20;
}

void Widget::on_pushButton_speed_10_clicked()
{
    _speed = 10;
}

void Widget::on_pushButton_speed_50_clicked()
{
    _speed = 50;
}

void Widget::on_pushButton_target_clicked()
{
    qDebug("Don`t fucking touch me!!!");
}
void Widget::on_pushButton_up_clicked()
{
    QRect rect = ui->pushButton_target->geometry();
    qDebug()<<rect;
    ui->pushButton_target->setGeometry(rect.x(),
    rect.y() - _speed,rect.width(),rect.height());
}


void Widget::on_pushButton_right_clicked()
{
    QRect rect = ui->pushButton_target->geometry();
    qDebug()<<rect;
    ui->pushButton_target->setGeometry(rect.x() + _speed,
    rect.y(),rect.width(),rect.height());
}

void Widget::on_pushButton_left_clicked()
{
    QRect rect = ui->pushButton_target->geometry();
    qDebug()<<rect;
    ui->pushButton_target->setGeometry(rect.x() - _speed,
    rect.y(),rect.width(),rect.height());
}

void Widget::on_pushButton_down_clicked()
{
    QRect rect = ui->pushButton_target->geometry();
    qDebug()<<rect;
    ui->pushButton_target->setGeometry(rect.x(),
    rect.y() + _speed,rect.width(),rect.height());
}
